package com.example.demo.mapper;

import com.example.demo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface UserMapper {

    //根据id获取User
    public UserInfo getUserById(@Param("id") Integer id);
    
    //根据id修改名称
    public int updateNameById(@Param("id") Integer id,
                      @Param("name") String username);

    //根据id删除User
    public int deleteUserById(@Param("id") Integer id);

    //添加User(不加自增主键)
    public int addUser(UserInfo userInfo);

    //添加User(有自增主键)
    public int addGetId(UserInfo userInfo);

}
